package com.example.ticketorder.service;

import com.example.ticketorder.entity.Ticket;
import com.example.ticketorder.repository.dao.TicketDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.Date;
import java.sql.Time;

@Service
public class TicketService {
    @Resource
    private TicketDao ticketDao;
    public Iterable<Ticket> findAll() {
        return ticketDao.findAll();
    }
    //自定义方法
    public Iterable<String> findDestination() {
        return ticketDao.findDestination();
    }
    public String findDest(String car,String departure){
        return ticketDao.findDest(car,departure);
    }
    public Iterable<String> findCar(){
        return ticketDao.findCar();
    }
    public Iterable<String> findDTime(){
        return ticketDao.findDTime();
    }
    public int findPoll(String car){
        return ticketDao.findPool(car);
    }
    public int findZpoll(String car,String departure){
        return ticketDao.findZpoll(car,departure);
    }
    public Iterable<String> findSite(String car,String departure){
        return ticketDao.findSite(car,departure);
    }
    public Iterable<String> findDeparture(String car,Time Htimeb){
        return ticketDao.findDeparture(car,Htimeb);
    }
    public Iterable<String> findZcar(String departure,Time Htimea,String car){
        return ticketDao.findZcar(departure,Htimea,car);
    }
    public double findMoney(String car,String destination){
        return ticketDao.findMoney(car,destination);
    }
    public Iterable<String> findScar(String destination, Date Dtime){
        return ticketDao.findScar(destination,Dtime);
    }
    public Time findHtimea(String car, String departure){
        return ticketDao.findHtimea(car,departure);
    }
    public Time findHtimeb(String car,String destination){
        return ticketDao.findHtimeb(car,destination);
    }
    public Time findZHtimeb(String destination,String car){
        return ticketDao.findZHtimeb(destination,car);
    }

    //更改数据
    public void updatePoll(String car,String departure){
        ticketDao.updatePoll(car,departure);
    }
    public void updatePollq(String car,String departure){
        ticketDao.updatePollq(car,departure);
    }
}
